<?php $this->_extends('_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
	<h3 style="float:left; margin:10px 0px 16px 10px;"></h3>
			<div class="entry">
			<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tr>
					<td class="score">
						<?=$row['score'] ?>
					</td>
					<td class="body">
						<?php if (isset($tomorrow)): ?>
							<a class="ui-corner-all" style="display: block; float:right; margin: 10px; border: #949AAA 1px solid; background-color:#949AAA; color:white; padding: 5px; font-size: 14px;" href="<?=url("sec/comment","id/$id/date/$tomorrow") ?>" style="color:white">下一个7天的评论»</a>
						<?php endif;?>
							<a class="ui-corner-all" style="float:right; margin: 10px; border: #949AAA 1px solid; background-color:#949AAA; color: white; padding: 5px; font-size: 14px;" href="<?=url("sec/comment", "id/$id/date/$yesterday") ?>" style="color:white">«上一个7天的评论</a>
						<span class="name"><?=h($row['name']) ?> (<?= h($row['code']) ?>)@<?=$dateFrom ?> 至 <?=$dateTo ?></span><br />
						<span class="action"><a href="" class="j-stock-up j-login-pop">*涨+1</a> <a href="" class="j-stock-down j-login-pop">*跌-1</a> <a href="" class="j-stock-comment j-login-pop">*评+0</a> 
						<?php if(isset($row['follow']) && $row['follow']): ?>
							<span style="font-size:19px">"</span>已关注<span style="font-size:19px">"</span>
						<?php else:?>
							<a href="" class="j-stock-favor j-login-pop">*关注</a>
						<?php endif;?>
							<img class="follow-ajax-loader" src="/img/ajax-loader.gif" style="display:none" /><label style="color:red" class="follow-publish-err"></label></span><br />
						<div class="description">排名<?=$row['sec_order'] ?> - 看涨<?=$row['upCnt'] ?>，看跌<?=$row['downCnt'] ?>，评论<?=$row['allCnt'] ?>，关注<?=$row['follow_cnt'] ?></div>
						<div class="comments" style="display:none;">
								<form method="post">
									<div class="text">
										<span>看涨:</span><br />
										<input type="hidden" name="type" value="1" />
										<input type="hidden" name="id" value="<?=$id ?>" />
										<textarea name="content"></textarea>
									</div>
									<div class="buttons">
										<input type="button" class="j-submit-comment" value="发布" />
										<a href="#" class="j-cancel-comment">取消</a>
										<label class="ajax-loader"><img src="/img/ajax-loader.gif" />正在保存</label><label style="color:red" class="publish-err"></label>
									</div>
								</form>
						</div><!-- comments end -->
					</td>
				</tr>
			</table>
		</div>
		<h3 style="float:left; margin:20px 0px 15px 10px;"><?=$dateFrom ?> 至 <?=$dateTo ?> 的评论：</h3>
		<div class="my-comments" style="margin-bottom: 30px;">
		<?php if(isset($comments) && count($comments) > 0) : foreach($comments as $key=>$comment):?>
			<div class="entry">
				<div class="comment-info"><a href="/people/<?=h($comment['username']) ?>"><?=h($comment['nickname']) ?></a>@<?=$comment['comment_time'] ?> ~<?=($comment['vote'] == 1) ? '涨' : ($comment['vote'] == 0 ? '评' : '跌')?>: </div>
				<p>
				<?=nl2p(h($comment['comment'])) ?>
				</p>
			</div>
		<?php endforeach; else:?>
			<p style="background-color: #eee; padding: 10px; text-align: center;"><span style="color: #CD1821; font-size: 15px;">又是新的一天，让我们开始新的评论吧!!</span> <br /><br />你也可以点击右上角的<span style="font-weight: bold;  padding: 5px; font-size: 14px;">"上一个7天的评论"</span>链接，查看以前的评论！</p>
		<?php endif;?>
		</div>
		
		<div class="clear"></div>
		<div class="entry">
			<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tr>
					<td class="body">
						<span class="action"><a href="" class="j-stock-up j-login-pop">*涨+1</a> <a href="" class="j-stock-down j-login-pop">*跌-1</a> <a href="" class="j-stock-comment j-login-pop">*评+0</a> 
						<?php if(isset($row['follow']) && $row['follow']): ?>
							<span style="font-size:19px">"</span>已关注<span style="font-size:19px">"</span>
						<?php else:?>
							<a href="" class="j-stock-favor j-login-pop">*关注</a>
						<?php endif;?>
							<img class="follow-ajax-loader" src="/img/ajax-loader.gif" style="display:none" /><label style="color:red" class="follow-publish-err"></label></span>
						<div class="comments">
								<form method="post">
									<div class="text">
										<span>评论:</span><br />
										<input type="hidden" name="type" value="0" />
										<input type="hidden" name="id" value="<?=$id ?>" />
										<textarea name="body"></textarea>
									</div>
									<div class="buttons">
										<input type="button" class="j-submit-comment" value="发布" />
										<a href="#" class="j-cancel-comment">取消</a>
										<label class="ajax-loader"><img src="<?=url("img/ajax-loader.gif") ?>" />正在保存</label><label style="color:red" class="publish-err"></label>
									</div>
								</form>
						</div><!-- comments end -->
					</td>
				</tr>
			</table>
		</div>
		<br />
		
<?php $this->_endblock(); ?>
